package top.chenyaohua.utils;

import top.chenyaohua.beans.MapperBean;
import top.chenyaohua.init.InitExecution;

import java.util.ArrayList;
import java.util.List;

public class InitExecutionUtils {

    private static ThreadLocal<List<? extends InitExecution>> threadLocal = ThreadLocal.withInitial(()->new ArrayList<>());
    private static List<MapperBean> mapper = new ArrayList<>();


    public static void set(List<? extends InitExecution> initExecution){
        threadLocal.set(initExecution);

    }

    public static List<? extends InitExecution> get(){
       return threadLocal.get();
    }

    public static void remove(){
        threadLocal.remove();

    }

    public static List<MapperBean> getMapper () {
        return mapper;
    }

    public static void setMapper (List<MapperBean> mapper) {
        InitExecutionUtils.mapper = mapper;
    }
}
